Creating Wizard Output Templates

The Wizard Markup Language (WIZML) enables the customization of files produced by the wizards. WIZML is used inside the templates to dynamically create files based on the data provided by the wizard. For example, if a wizard generates a tag called <GIZMO> with a single attribute FILEPATH, the template could look as simple as this:

<GIZMO FILEPATH="$${txtFilePath}">

This example will create a file with a single <GIZMO> tag. Notice the syntax $${variablename} that is used to populate the value of FilePath with the actual value entered in the wizard.

WIZML output templates use a high-level markup syntax that works very much like CFML. Supported tags include WIZSET, WIZELSE/WIZELSEIF, WIZLOOP, and WIZINCLUDE. In addition, a simple expression syntax that is a subset of the ColdFusion expression syntax and function library is supported within output templates.

Note Whenever you make changes to a VTM file or create a new one, save the file, then press Ctrl+Alt+Shift+C to apply the changes.

Parameters

Output templates are driven by the values of parameters, much like ColdFusion templates are driven by the values of Form and URL parameters. Parameters can be output directly or can be used to customize the type of output generated. The values of these wizard parameters can originate from several locations:

To output the value of a parameter within a template, use a double dollar sign escape sequence. For example, to output the value of a variable named Color you would use the syntax $${Color}. While this is the recommended syntax, you can use a simpler form when for a parameter value within the attribute of a WIZ tag. For example, <WIZIF Color= "black"> is valid.

Expressions and functions

In addition to outputting and manipulating simple parameter values, an expression syntax is also provided. To output the value of an expression, you add a set of curly braces to the $$ and include the expression within the braces, for example:

$${ 'This is the ' & Color }

$$( 'The result of 7 divided by 22 is ' & 7/22 }

$$( Left( 'FooBar', 3 ) }

Strings are delimited using the single quote character. Arithmetic and concatenation operators are supported (+,-,*,/,&). The comparison operators LT, LTE, GT EQ, and NEQ are supported, and logical comparisons using AND, NOT, and OR are supported.

The two main categories of functions currently supported are string and runtime.

String functions

Runtime functions

The syntax and behavior of all of these functions is identical to the equivalent functions in ColdFusion, except for ParameterExists, which takes a string argument rather than a direct variable reference.

WIZ Tags

The behavior of wizard output templates is controlled by the use of WIZ tags in the template. These tags are like ColdFusion tags except that they are prefixed with the characters WIZ instead of ColdFusion.

Supported tags

Special considerations

Strings used within an output template tag attribute use the C-language convention (\) for escaping special characters. For example, the following attribute uses a newline character to split the value into two lines:

CAPTION="This is line one\nThis is line two"

Other special characters of note include carriage-return (\r), tab (\t), and slash (\\). For example, the following attribute references a template in a directory two levels above the current directory:

TEMPLATE="..\\..\\Header.wml"

WIZML reference

Following is the complete Wizard Markup Language syntax.

WIZSET

WIZSET works the same way as the ColdFusion CFSET tag.

For example:

<WIZSET Color = 'Red'>
<WIZSET Pi = 7/22>
<WIZSET ShortName = Left( LongName, 5 )>

The following table describes the WIZINCLUDE tag.

Attribute Description
TEMPLATE Required. The relative path of a template that is to be included in the currently executing template.

WIZLOOP, WIZBREAK, and WIZCONTINUE

The WIZLOOP tag supports several types of loops including:

The following table describes the WIZLOOP tag.

WIZLOOP Tag Attributes 
Attribute Description 
INDEX Name of a variable for a loop to set on each iteration (required for index and list-based loops). It serves as a counter.
FROM Index to start looping from.
TO Index to loop to.
STEP Step value for each increment (can be positive or negative).
CONDITION Conditional expression to control whether the loop should be exited.
LIST A list of CommaText format. This is the format that a Delphi-based string list uses to store textual representations of itself.
STRINGLIST The name of a parameter created with the SetObjectParameter function which is of type TStringList.

The WIZBREAK and WIZCONTINUE tags have no attributes, and can be placed anywhere within a WIZLOOP tag to either exit the loop (WIZBREAK) or move on to the next loop iteration (WIZCONTINUE).

WIZIF, WIZELSEIF, and WIZELSE

The WIZIF, WIZELSEIF, and WIZELSE tags work identically to the corresponding CFML tags. Any valid Boolean expression can be used in the WIZIF and WIZELSEIF tags.

<WIZIF sDocType eq "HTML 4.0">

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional// EN">
<wizelse sDocType eq "HTML 3.2">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<wizelse sDocType eq "HTML 2.0">
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

</WIZIF>

<HTML>
<HEAD>
<TITLE>$${sTitle}</TITLE>

<WIZIF bMetaDescr eq "true">
<META NAME="description" CONTENT="$${sMetaDescr}">
</WIZIF>

<WIZIF bMetaKeywords eq "true">
<META NAME="keywords" CONTENT="$${sMetaKeywords}">
</WIZIF>

</HEAD>
<BODY>


</BODY>
</HTML>